< previous page page_196 next page >

Page 196
Chapter Objectives
Learn about the built-in Visual Basic functions
Learn about string functions
Learn about date functions
Learn about methods
Sample Project File: \Chapter10\VBFuncs.vbp
Using Built-in Functions
Visual Basic has many built-in functions that are a part of the base language and may be called at any time from your procedures. Table 10.1 is a list of some of the more common ones youll use. A complete list of functions can be found in the Visual Basic Books Online.
Notice that many of the functions have two formswith a trailing dollar sign ($) and without. Those with the dollar sign return a value as a String data type. Those without it return a value as a variant data type with the VarType string.
Table 10.1 Most Commonly Used Built-in Functions.
Function(s)Description
Chr, Chr$Convert an ASCII value to a string
AscConverts a string to an ASCII value
Str, Str$Convert a number to a string
Format, Format$Convert a number to a formatted string
ValConverts a string to a number
Date, Date$Get current system date
NowGets current system date and time
Time, Time$Get current system time
InputBox, InputBox$Display an input box and prompt the user for one string
MsgBoxDisplays a message box
LCase, LCase$Convert a string to lowercase
UCase, UCase$Convert a string to uppercase

(table continued to next page)

 
< previous page page_196 next page >

If you like this book, buy it!